package com.woniuxy.email;

import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2024-10-23
 * @desc 蜗牛创想：www.woniuxy.com
 */
@SpringBootTest
public class MQTest03 {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void send01(){

        String  key1 = "woniuxy.cd";
        String  key2 = "news.woniuxy.cd";
        String  key = "news.woniuxy";
        String msg = "腾讯和蜗牛达成战略学习 给腾讯培训厨师";
        rabbitTemplate.convertAndSend("topic.exchange",
                key,
                msg);
    }
}
